#!/bin/bash

# ------How to Use:----------

# -----kill before running------
# ps -ef | grep "start_geneval" | grep -v grep | awk '{print $2}' | xargs -r kill -9
# ps -ef | grep "gunicorn app_geneval:create_app" | grep -v grep | awk '{print $2}' | xargs -r kill -9
# lsof -ti:18089 | xargs -r kill -9

# -----run in background------
# bash start_geneval.sh

LOG_FILE="/root/xjh/gen_eval/geneval_gunicorn.log"
nohup gunicorn "app_geneval:create_app()" \
    --bind 0.0.0.0:18089 \
    --workers 4 \
    --timeout 480 \
    --max-requests 100 \
    --max-requests-jitter 20 \
    >> "$LOG_FILE" 2>&1 &